﻿
@{
    Layout = null;
}
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title>后台登录</title>
    <link rel="stylesheet" type="text/css" href="~/admin/layui/css/layui.css" />
    <link rel="stylesheet" type="text/css" href="~/admin/css/login.css" />
</head>

<body>
    <div class="m-login-bg">
        <div class="m-login">
            <h3>后台系统登录</h3>
            <div class="m-login-warp">
                <form class="layui-form">
                    <div class="layui-form-item">
                        <input type="text" name="AdminName" required lay-verify="required" placeholder="用户名" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-form-item">
                        <input type="password" name="AdminPwd" required lay-verify="required" placeholder="密码" autocomplete="off" class="layui-input">
                    </div>
                    <div class="layui-form-item m-login-btn">
                        <div class="layui-inline">
                            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="login">登录</button>
                        </div>
                        <div class="layui-inline">
                            <button type="reset" class="layui-btn layui-btn-primary">取消</button>
                        </div>
                    </div>
                </form>
            </div>
            <p class="copyright"></p>
        </div>
    </div>
    <script src="~/admin/js/jquery-3.0.0.min.js"></script>
    <script src="~/admin/layui/layui.js" type="text/javascript" charset="utf-8"></script>
    <script>
        layui.use(['form', 'layedit', 'laydate'], function () {
            var form = layui.form(),
                layer = layui.layer;

            //监听提交
            form.on('submit(login)', function (data) {
                $.post("/Home/checkLoginAsync", data.field, function (res) {
                    if (res == "0") { layer.msg('用户名或密码错误!'); }
                    else {
                        window.location.href = res;
                    }
                })
                //layer.alert(JSON.stringify(), {
                //	title: '最终的提交信息'
                //})
                return false;
            });

        });
    </script>
</body>

</html>
